//网页真正需要的权限路由
//（顺序是先是对比路由然后成为动态路由的子路由最后再调用router.addRoutes(动态路由)）

const dynamicRoutes = [
  {
    path: "/",
    redirect: "/welcome",
    component: () => import(/*webpackChunkName:'home'*/ "../pages/Home"),
    //因为每个用户有需要vip充值页面和支付页所以不做动态处理
    children: [
      //vip充值
      {
        path: "vipmanager",
        name: "vipmanager",
        component: () => import(/*webpackChunkName:'vipManager'*/ "../pages/Home/vipManager"),
        meta: {
          name: "vip管理首页",
          fullPath: "/vipmanager",
        },
        children: [
          {
            path: "viporder",
            name: "viporder",
            component: () => import(/*webpackChunkName:'viporder'*/ "../pages/Home/vipManager/viporder"),
            meta: {
              name: "vip订单",
              fullPath: "/vipmanager/viporder",
            },
          },
          {
            path: "vipcharge",
            name: "vipcharge",
            component: () => import(/*webpackChunkName:'vipcharge'*/ "../pages/Home/vipManager/vipcharge"),
            meta: {
              name: "vip充值",
              fullPath: "/vipmanager/vipcharge", //当前路由的完整路径
            },
          },
        ],
      },
      //vip订单详情页
      {
        path: "pre_order",
        name: "pre_order",
        component: () => import(/*webpackChunkName:'pre_order'*/ "../pages/Home/Preorder"),
        meta: {
          name: "预支付",
        },
      },
      //
      {
        path: "payment",
        name: "payment",
        component: () => import(/*webpackChunkName:'payment'*/ "../pages/Home/PayMent"),
        meta: {
          name: "支付主页",
        },
        children: [
          {
            path: "pay",
            name: "pay",
            component: () => import(/*webpackChunkName:'pay'*/ "../pages/Home/PayMent/pay"),
            meta: {
              name: "支付页面",
            },
          },
          {
            path: "paysuccess",
            name: "paysuccess",
            component: () => import(/*webpackChunkName:'paysuccess'*/ "../pages/Home/PayMent/paysuccess"),
            meta: {
              name: "支付成功",
            },
          },
        ],
      },
    ],
  },
  {
    path: "*",
    component: () => import(/*webpackChunkName:'404'*/ "../pages/404"),
  },
];

export default dynamicRoutes;
